﻿//自动义双击方法
function CustomDbClick() {
//    var recordID = myDataTable.getSelectedRows()[0];
//    record = myDataTable.getRecord(recordID);
//    var vid = record.getData("PayId");
//    if (vid != "") {
//        window.parent.$("#tabs").tabs('close', '查看缴款单信息');
//        var pagetitle = "查看缴款单信息";
//        parent.addTabs(pagetitle, '../Crm/Modules/AddPay.aspx?r=' + Math.random() + '&view=checks&flag=1&entity=' + const_EditEntity + '&id=' + vid + '&title=' + encodeURI(pagetitle));
//        parent.NeedRefreshPage = this;
//    }
}
//审核
var fnCheck = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }

    var SetManagerURL = "../../Crm/Modules/AddInvoiceInfo.aspx?r=";
    var vid = record.getData(const_entityID); 
    if (vid != undefined && vid != "") {
        var pagetitle = "审核操作";
        document.getElementById("EditUIWindow").src = SetManagerURL + Math.random() + "&view=check&strOrderId=" + record.getData("OrderID") + "&id=" + vid + "&title=" + encodeURI(pagetitle) + "";
        YAHOO.example.container.dialog1.show();
        document.getElementById("yui-gen31-button").style.display = "block";
    }
}
//审核佣金
var fnCheckCommission = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }

    var SetManagerURL = "../../Crm/Modules/AddCommission.aspx?r=";
    var vid = record.getData(const_entityID);
    if (vid != undefined && vid != "") {
        var pagetitle = "佣金操作";
        document.getElementById("EditUIWindow").src = SetManagerURL + Math.random() + "&entity=CrmCommision&OrderProductId=" + record.getData("OrderProductId") + "&id=" + vid + "&title=" + encodeURI(pagetitle) + "";
        YAHOO.example.container.dialog1.show();
        document.getElementById("yui-gen31-button").style.display = "block";
    }
}
//格式化时间
var fnDate = function (elCell, oRecord, oColumn, sData) {
    if (sData == "0001-01-01 ") {
        elCell.innerHTML = "";
    } else {
        elCell.innerHTML = sData;
    }
 };